<?php 

function dbg($data){
	echo '<pre>';
	print_r($data);
	echo '</pre>';
}

class Cloud {
	
	public function __construct(){
		$this->cloud	=& CC_Core::get_instance();
		$this->data	=& $this->cloud->data;
	}
	
	public function load_class(){
	
		$classes = func_get_args();
	
		foreach($classes as $class){
			$this->cloud->load_class($class);
		}
	}
	
	public function load_model($model){
		global $modulesDir;
		
		include $modulesDir.'/models/m.'.$model.'.php';
		
		$modelClass = $model.'_model';
		$this->$model = new $modelClass;
	}
	
	public function load_helper($model){
		global $class_library;
		
		$file = $class_library.'/helpers/'.$model.'.php';
		
		if(file_exists($file) === true){
			include $file;
		}
	}
	
	public function display($file){
		$this->cloud->tpl->display($file);
	}
}

?>